Package-level declarations

Types

Link copied to clipboard
class Audio

A complete generated audio response.

Link copied to clipboard

An arbitrary chunk of a streaming audio response.

Link copied to clipboard
data class OutputFormat(val value: String)

Audio encoding and sample-rate identifier accepted by ElevenLabs.

Link copied to clipboard
fun interface RealtimeTokenProvider

Supplies a fresh single-use token immediately before a realtime TTS connection is opened. The SDK does not cache returned tokens and rejects blank values.

Link copied to clipboard
data class RealtimeTtsAlignment(val characters: List<String>, val characterStartTimesMs: List<Int>, val characterDurationsMs: List<Int>)

Character-level timing metadata for a realtime audio event.

Link copied to clipboard
sealed interface RealtimeTtsAuthorization

Credentials used to open a realtime text-to-speech connection.

Link copied to clipboard
sealed interface RealtimeTtsEvent

Event emitted by a RealtimeTtsSession.

Link copied to clipboard
data class RealtimeTtsGenerationConfig(val chunkLengthSchedule: List<Int>)

Controls how much text ElevenLabs buffers before realtime audio generation.

Link copied to clipboard
data class RealtimeTtsKeepAlive(val enabled: Boolean = true, val intervalMillis: Long)

Keeps an otherwise idle ElevenLabs TTS WebSocket session open.

Link copied to clipboard
data class RealtimeTtsOptions(val modelId: String? = null, val languageCode: String? = null, val outputFormat: OutputFormat = OutputFormat.Mp3_44100_128, val voiceSettings: VoiceSettings? = null, val generationConfig: RealtimeTtsGenerationConfig? = null, val enableLogging: Boolean = true, val syncAlignment: Boolean = false, val enableSsmlParsing: Boolean = false, val timeouts: RealtimeTtsTimeouts = RealtimeTtsTimeouts(), val keepAlive: RealtimeTtsKeepAlive = RealtimeTtsKeepAlive(), val reconnectPolicy: RealtimeTtsReconnectPolicy = RealtimeTtsReconnectPolicy.Never)

Configuration applied when opening a realtime text-to-speech connection.

Link copied to clipboard

Controls if a realtime TTS connection may be opened again after a transient failure.

Link copied to clipboard

A controllable realtime text-to-speech WebSocket session.

Link copied to clipboard
data class RealtimeTtsTimeouts(val connectTimeoutMillis: Long, val sendTimeoutMillis: Long, val finishTimeoutMillis: Long, val inactivityTimeoutSeconds: Int = 60)

Time limits applied to a realtime text-to-speech session.

Link copied to clipboard
interface TextToSpeechApi

Generates speech from complete or incrementally produced text.

Link copied to clipboard
data class TextToSpeechRequest(val voiceId: String, val text: String, val modelId: String? = null, val languageCode: String? = null, val voiceSettings: VoiceSettings? = null, val outputFormat: OutputFormat = OutputFormat.Mp3_44100_128, val enableLogging: Boolean = true)

Input for complete or HTTP-streamed text-to-speech generation.

Link copied to clipboard
data class VoiceSettings(val stability: Double? = null, val similarityBoost: Double? = null, val style: Double? = null, val useSpeakerBoost: Boolean? = null, val speed: Double? = null)

Optional controls that tune the generated voice.